using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using DIALOGUE;

namespace TEST
{
    public class Test_ConversationQueue : MonoBehaviour
    {
        // Start is called before the first frame update
        void Start()
        {
            StartCoroutine(Running());
        }

        IEnumerator Running()
        {
            List<string> lines = new List<string>()
            {
                "this is line 1 from the original conversation.",
                "this is line 2 from the original conversation.",
                "this is line 3 from the original conversation."
            };

            yield return DialogueSystem.instance.Say(lines);
            DialogueSystem.instance.Hide();
        }

        private void Update()
        {
            List<string> lines = new List<string>();
            Conversation conversation = null;

            if (Input.GetKeyDown(KeyCode.Q))
            {
                lines = new List<string>()
                {
                    "this is the start of an enqueued conversation.",
                    "we can keep going!"
                };
                conversation = new Conversation(lines);
                DialogueSystem.instance.conversationManager.Enqueue(conversation);
            }

            if (Input.GetKeyDown(KeyCode.W))
            {
                lines = new List<string>()
                {
                    "this is a important infomation.",
                    "5.1 is a international worker day!"
                };
                conversation = new Conversation(lines);
                DialogueSystem.instance.conversationManager.EnqueuePriority(conversation);
            }

        }
    }
}